package org.langqiao.jvm.base;

import java.net.URL;  
import java.net.URLClassLoader; 

public class BootStrapTest {

	/*public static void main(String[] args) {
		URL[] urls = sun.misc.Launcher.getBootstrapClassPath().getURLs(); 
		for(int i=0;i<urls.length;i++){
			System.out.println(urls[i].toExternalForm());
		}
	}
*/
	public static void main(String[] args)  
    {  
        System.out.println("BootstrapClassLoader 的加载路径: ");  
          
        URL[] urls = new  URL[10];
        //sun.misc.Launcher.getBootstrapClassPath().getURLs();  
        for(URL url : urls)  
            System.out.println(url);  
        System.out.println("----------------------------");  
                  
        //取得扩展类加载器  
        URLClassLoader extClassLoader = (URLClassLoader)ClassLoader.getSystemClassLoader().getParent();  
  
        System.out.println(extClassLoader);  
        System.out.println("扩展类加载器 的加载路径: ");  
          
        urls = extClassLoader.getURLs();  
        for(URL url : urls)  
            System.out.println(url);  
          
        System.out.println("----------------------------");  
                  
          
        //取得应用(系统)类加载器  
        URLClassLoader appClassLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();  
          
        System.out.println(appClassLoader);  
        System.out.println("应用(系统)类加载器 的加载路径: ");  
          
        urls = appClassLoader.getURLs();  
        for(URL url : urls)  
            System.out.println(url);  
                  
        System.out.println("----------------------------");   
    }  
}
